import request from "@/utils/request";

export const login = async data => {
  return request({
    url: "/manager/checkLogin",
    method: "post",
    data
  });
};
export const logout = async () => {
  return request({
    url: "/manager/checkLogin",
    method: "post"
  });
};
export const modifyPass = async data => {
  return request({
    url: "/user/modify",
    method: "post",
    data
  });
};
export const getInfo = async data => {
  return request({
    url: "/manager/checkLogin",
    method: "get",
    data
  });
};
export const sendCheckCode = async data => {
  return request({
    url: "/manager/sendCheckCode",
    method: "get",
    params: data
  });
};
export const setHeadPortrait = async data => {
  return request({
    url: "/manager/setHeadPortrait",
    method: "post",
    data
  });
};
export const modifyPhone = async data => {
  return request({
    url: "/manager/modifyPhone",
    method: "post",
    data
  });
};
export const getLoginUserInfo = async data => {
  return request({
    url: "/manager/loadOne",
    method: "get",
    params: data
  });
};
export const getPermissionRoutes = async data => {
  return request({
    url: "/menuRole/loadAllIdsByUser",
    method: "post",
    data
  });
};
export const modifyPassword = async data => {
  return request({
    url: "/manager/modifyPassWordForBackstage",
    method: "post",
    data
  });
};
export const getJobAndDept = async data => {
  return request({
    url: "/staff/job/loadAllInfoByProperty",
    method: "get",
    params: data
  });
};
export const deleteDept = async data => {
  return request({
    url: "/staff/department/delete",
    method: "get",
    params: data
  });
};
export const deleteJob = async data => {
  return request({
    url: "/staff/job/delete",
    method: "get",
    params: data
  });
};
export const getActions = async data => {
  return request({
    url: "/menuRole/loadAllByJob",
    method: "post",
    data
  });
};
export const editJob = async data => {
  return request({
    url: "/staff/job/modify",
    method: "post",
    data
  });
};
export const editAction = async data => {
  return request({
    url: "/menuRole/setMenuRole",
    method: "post",
    data
  });
};
export const addJob = async data => {
  return request({
    url: "/staff/job/add",
    method: "post",
    data
  });
};
export const editDept = async data => {
  return request({
    url: "/staff/department/modify",
    method: "post",
    data
  });
};
export const addDept = async data => {
  return request({
    url: "/staff/department/add",
    method: "post",
    data
  });
};
export const getAllDept = async data => {
  return request({
    url: "/staff/department/loadAllBySelect",
    method: "get",
    params: data
  });
};
export const getJobByDept = async data => {
  return request({
    url: "/staff/job/loadSelectByDepartment",
    method: "get",
    params: data
  });
};
export const getAllInnerUser = async data => {
  return request({
    url: "/manager/loadAllByQuery",
    method: "post",
    data
  });
};
export const deleteInnerUser = async data => {
  return request({
    url: "/manager/delete",
    method: "get",
    params: data
  });
};
export const editInnerUser = async data => {
  return request({
    url: "/manager/modify",
    method: "post",
    data
  });
};
export const getInnerUser = async data => {
  return request({
    url: "/manager/loadOne",
    method: "get",
    params: data
  });
};
export const addInnerUser = async data => {
  return request({
    url: "/manager/add",
    method: "post",
    data
  });
};
